﻿
//
//
//

namespace Microsoft.OpenTurf.Silverlight.Shared
{
    using System;

    public static class TranslatorProvider<T>
    {
        public static ITranslator<IFeedItem, T> CurrentFeedTranslator
        {
            get
            {
                Attribute attr = Attribute.GetCustomAttribute(typeof(T), typeof(FeedItemTranslatorAttribute));
                FeedItemTranslatorAttribute feedAttr = attr as FeedItemTranslatorAttribute;
                Type t = feedAttr.TranslatorType;

                return Activator.CreateInstance(t) as ITranslator<IFeedItem, T>;
            }
        }
    }
}
